﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="AdsManage.aspx.cs" Inherits="FYPHP.AdvertisementManage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="LeftContent" runat="server">
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript">    var num = 0; </script>
   <asp:Repeater ID="ItemList" runat="server" EnableViewState="False" 
        onitemcommand="ItemList_ItemCommand">
<HeaderTemplate>
<h2>Advertisments Manage</h2>
<table cellpadding="5" cellspacing="5" width="722" border="1px solid #ffffff" align="center" style="border-collapse: collapse; border-color: #aaaaaa; text-align: center">
 <tr style="background-color: #eee; font-weight: bold;"><td width="20px">No.</td><td width="25">Image</td><td align="left">Advertisement Link</td><td width="50">Status</td><td width="50">Duration</td><td width="190">Actions</td></tr>

</HeaderTemplate>

<ItemTemplate>
     <tr>
            <td><script type="text/javascript">num += 1; document.write(num);</script></td>
            <td align="center">
            <img src="\uploads\ads\<%#DataBinder.Eval(Container.DataItem, "a_picture" ) %>" alt="" height="25px" width="25px" />
            </td>
            <td style="text-align: left"><a href="<%#DataBinder.Eval(Container.DataItem, "a_link" ) %>" target="_blank"><%#DataBinder.Eval(Container.DataItem, "a_link" ) %></a><br />
            <span style="font-size:11px; text-align: right; color: #888;"><i><%#DataBinder.Eval(Container.DataItem, "a_date" ) %></i></span></td>
            <td style="text-align: center; text-transform : capitalize;"><%#DataBinder.Eval(Container.DataItem, "a_status" ) %></td>
            <td style="text-align: center"><%#DataBinder.Eval(Container.DataItem, "a_duration" ) %> days</td>
            <td><asp:Button ID="Button2" runat="server" Text="Change" CommandName="ChangeAds" 
        CommandArgument='<%# Eval("a_id").ToString() %>' />
        <asp:Button ID="btnEdit" runat="server" Text="Edit" CommandName="EditAds" 
        CommandArgument='<%# Eval("a_id").ToString() %>' />
        <asp:Button ID="Button1" runat="server" Text="Remove" CommandName="RemoveAds" OnClientClick="return confirm('Are you sure you want to remove this advertisement?');" 
        CommandArgument='<%# Eval("a_id").ToString() %>' /></td>
        </tr>
       
   </ItemTemplate>

   <FooterTemplate>
   
    </table>
    </FooterTemplate>
</asp:Repeater>
</asp:Content>
